import {Card, Row, Col, List, Typography, Table, Tag} from "antd";
import Base from "@/pages/Province/SubjectsOverview/components/Base";
import {FileWordOutlined} from "@ant-design/icons";
import {nanoid} from "@ant-design/pro-components";
import Pie from '@/pages/Province/SubjectDetail/components/Pie'
import Table_01 from "./components/Table_01";
import Emm01_1 from './components/Emm01_1'
import React, {useEffect, useState} from "react";
import {OverView02Awards, OverView02Platform} from "@/services/Province/Dashboard";

export default (props) => {

  // 专任教师队伍数据
  const teacherGroupData = [
    {
      title: '高层次人才及团队',
      number: 200,
    },
    {
      title: '国家级团队和学术领军人才',
      number: 2000,
    },
    {
      title: '省重点人才',
      number: 2001,
    },
    {
      title: '学科专任教师',
      number: 2022,
    },
    {
      title: '博士后和科研助理',
      number: 211,
    },
    {
      title: '外籍专任教师数量',
      number: 20,
    },
  ]

  // 国际水平数据
  const foreignLevelData = [{value: 10, name: '担任国内外重要期刊负责人'}, {value: 10, name: '在国内重要学术组织任职'}, {
    value: 5,
    name: '参加本领域重要学术会议做报告人'
  }, {value: 5, name: '担任国际比赛负责人'}]

  // const data = [
  //   {
  //     "dis_name": "南昌大学-绿色食品学科群",
  //     "rc_num": "14"
  //   },
  //   {
  //     "dis_name": "江西师范大学-马克思主义理论",
  //     "rc_num": "11"
  //   },
  //   {
  //     "dis_name": "江西财经大学-统计学",
  //     "rc_num": "10"
  //   },
  //   {
  //     "dis_name": "华东交通大学-交通运输工程",
  //     "rc_num": "8"
  //   },
  //   {
  //     "dis_name": "江西理工大学-冶金工程",
  //     "rc_num": "7"
  //   },
  //   {
  //     "dis_name": "景德镇陶瓷大学-陶瓷设计与美术",
  //     "rc_num": "6"
  //   },
  //   {
  //     "dis_name": "江西中医药大学-中药学",
  //     "rc_num": "6"
  //   },
  //   {
  //     "dis_name": "江西农业大学-畜牧学",
  //     "rc_num": "5"
  //   },
  //   {
  //     "dis_name": "东华理工大学-地质资源与地质工程",
  //     "rc_num": "5"
  //   },
  //   {
  //     "dis_name": "南昌航空大学-环境科学与工程",
  //     "rc_num": "4"
  //   },
  //   {
  //     "dis_name": "南昌大学-临床医学与公共卫生大健康",
  //     "rc_num": "4"
  //   }
  // ]

  const [awardsData, setAwardsData] = useState([])
  const [platformData, setPlatformData] = useState([])
  const [reload, setReload] = useState(false)

  useEffect(() => {
    OverView02Awards().then(res => {
      if (res.status === 0) {
        setAwardsData(res.data)
      }
    })
    OverView02Platform().then(res => {
      if (res.status === 0) {
        setPlatformData(res.data)
      }
    })
  }, [reload])

  return <Base props={props}>
    <Row gutter={[24, 24]}>
      {/*<Col span={24}><Card title="专任教师队伍">*/}
      {/*  <List*/}
      {/*    grid={{gutter: 16, column: 4}}*/}
      {/*    dataSource={teacherGroupData}*/}
      {/*    renderItem={item => (*/}
      {/*      <List.Item>*/}
      {/*        <Card title={item.title}>*/}
      {/*          <span style={{fontSize: 16}}>人数：<Typography.Text strong>{item.number}</Typography.Text>人</span>*/}
      {/*        </Card>*/}
      {/*      </List.Item>*/}
      {/*    )}*/}
      {/*  />*/}
      {/*</Card></Col>*/}
      <Col span={24}>
        <Card title="国家级教学成果奖数量">
          <Row gutter={[24, 24]}>
            <Col span={10}>
              <Table_01 data={awardsData} title="国家级教学成果奖数量" />
            </Col>
            <Col span={14}>
              <Emm01_1 data={awardsData} title="国家级教学成果奖数量" />
            </Col>
          </Row>
        </Card>
      </Col>
      <Col span={24}>
        <Card title="国家级人才培养平台/基地数量">
          <Row gutter={[24, 24]}>
            <Col span={10}>
              <Table_01 data={platformData} title="国家级人才培养平台/基地数量" />
            </Col>
            <Col span={14}>
              <Emm01_1 data={platformData} title="国家级人才培养平台/基地数量" />
            </Col>
          </Row>
        </Card>
      </Col>
      {/*<Col span={24}>*/}
      {/*  <Card title="师资队伍国际水平">*/}
      {/*    <Row gutter={24} justify="space-around" align="middle">*/}
      {/*      <Col span={12}>*/}
      {/*        <List*/}
      {/*          header={<Typography.Text strong>师资队伍国际水平人数情况</Typography.Text>}*/}
      {/*          bordered*/}
      {/*          dataSource={foreignLevelData}*/}
      {/*          renderItem={item => (*/}
      {/*            <List.Item>*/}
      {/*              <Typography.Text strong>{item.name}</Typography.Text>: <Tag color="blue">{item.value}人</Tag>*/}
      {/*            </List.Item>*/}
      {/*          )}*/}
      {/*        />*/}
      {/*      </Col>*/}
      {/*      <Col span={12}>*/}
      {/*        <Pie name="师资队伍国际水平人数占比情况"*/}
      {/*             data={foreignLevelData}*/}
      {/*             height="300px"*/}
      {/*        />*/}
      {/*      </Col>*/}
      {/*    </Row>*/}
      {/*  </Card>*/}
      {/*</Col>*/}
    </Row>
  </Base>
}
